package my.design.factory.prize;

/**
 * @author zp
 * @version 1.0
 * @description: 礼品的工厂模式
 * @date 2022/9/30 19:44
 */
public class StoreFactory {
    public ICommodity getCommodityService(Integer commodityType) {
        switch (commodityType){
            case 1:
                return new CouponCommodityService();
            case 2:
                return new GoodsCommodityService();
            case 3:
                return new CardCommodityService();
            default:
                throw new RuntimeException("不不存在的商品服务类型");
        }
    }
}
